package com.google.code.p.restrpc.core.async;

import java.util.Date;

/**
 * @author dz
 */
public class AsynServiceRequest {
    
    public static AsynServiceRequest create(String requestId,
                                            String serviceName,
                                            String methodName,
                                            Object body) {
        AsynServiceRequest request = new AsynServiceRequest();
        request.setRequestId(requestId);
        request.setServiceName(serviceName);
        request.setMethodName(methodName);
        request.setParams(body);
        request.setCreateDateTime(new Date());
        request.setStatus(AsyncServiceStatus.CREATED);
        return request;
    }
    
    private String requestId;
    
    private String serviceName;
    
    private String methodName;
    
    private Object params;
    
    private Date createDateTime;
    
    private AsyncServiceStatus status;
    
    /**
     * @return the requestId
     */
    public String getRequestId() {
        return requestId;
    }
    
    /**
     * @param requestId
     *            the requestId to set
     */
    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }
    
    /**
     * @return the serviceName
     */
    public String getServiceName() {
        return serviceName;
    }
    
    /**
     * @param serviceName
     *            the serviceName to set
     */
    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }
    
    /**
     * @return the methodName
     */
    public String getMethodName() {
        return methodName;
    }
    
    /**
     * @param methodName
     *            the methodName to set
     */
    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
    
    /**
     * @return the params
     */
    public Object getParams() {
        return params;
    }
    
    /**
     * @param params
     *            the params to set
     */
    public void setParams(Object params) {
        this.params = params;
    }
    
    /**
     * @return the createDateTime
     */
    public Date getCreateDateTime() {
        return createDateTime;
    }
    
    /**
     * @param createDateTime
     *            the createDateTime to set
     */
    public void setCreateDateTime(Date createDateTime) {
        this.createDateTime = createDateTime;
    }
    
    /**
     * @return the status
     */
    public AsyncServiceStatus getStatus() {
        return status;
    }
    
    /**
     * @param status
     *            the status to set
     */
    public void setStatus(AsyncServiceStatus status) {
        this.status = status;
    }
    
}
